The present disclosure relates generally to data compression and encryption. More specifically, the present disclosure relates to methods for compressing data using command encoding.
Computer files may be several megabytes or gigabytes in size, resulting in a need for compression in order to maximize storage on a given storage medium. While the cost of storage media has dropped significantly over time, the ability to compress the files for transfer or transmission remains desirable in order to reduce transmission time and bandwidth usage. As a secondary benefit, this process may serve to encrypt the data to some degree, providing enhanced security.
Data compression methods generally fall into two categories, known as “lossless” and “lossy.” Lossless methods of compression generally take advantage of repeated patterns within a file's data. Lossless methods faithfully reproduce every aspect of the data, but reduce overall size by replacing repetitive portions with smaller representative codes.
Lossy methods, on the other hand, generally change the data slightly, for example by homogenizing portions that have only slight variations. This in turn makes the data more amenable to compression by creating repeated patterns where before there were none. For example, a digital photograph of an outdoor scene may have hundreds of shades of blue in the sky portion of the photo. A lossy method may convert all of the blues into a single shade and therefore be able to encode the entire sky portion with a single data point. As the name lossy implies, some data is inevitably lost in translation (as in the photo, which when later decompressed will only have a single shade of blue in the sky where before there were many).